package com.voice.client;

import com.voice.client.api.SyncApiClient;
import com.voice.client.api.VoiceApiClientBuilderParams;
import com.voice.client.api.VoiceApiRequest;
import com.voice.core.api.model.ApiResponse;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.IOException;


//@SpringBootApplication
public class VoiceClientApplication2 {

    public static void main2(String[] args) throws IOException {
        //SpringApplication.run(VoiceClientApplication.class, args);
        VoiceApiClientBuilderParams params=new VoiceApiClientBuilderParams();
        params.setAppKey("你的<AppKey>");
        params.setAppSecret("你的<AppSecret>");
        SyncApiClient client=new SyncApiClient(params);

        String token="62c1c0ea571a4960b39d34f2a49e8c23";
        VoiceApiRequest request=new VoiceApiRequest();
        request.setToken(token);

        request.putParam("deviceKey","wangjc");
        request.putParam("text","test");
        ApiResponse apiResponse=client.putBody("127.0.0.1","/api/token",request);
        System.out.println(new String(apiResponse.getBody()));
        //request.putParam("url","http://127.0.0.1/user/login");
        //request.putFile("file",new File("D:\\java\\Welcome.html"));

        //ApiResponse apiResponse=client.getBody("127.0.0.1","/api/token");

        //ApiResponse apiResponse=client.postBody("127.0.0.1","/api/device/tts",request);

        //ApiResponse apiResponse=client.postBody("127.0.0.1","/api/device/url",request);

        //ApiResponse apiResponse=client.postFile("127.0.0.1","/api/device/file",request);



    }
}
